import request from '../utils/request';

/**
 * 获取所有地址
 */
export const getAddressListApi = () => {
  return request(`/userAddress/findUserAddress`);
}

/**
 * 获取默认地址
 */
export const getDefaultAddressApi = () => {
  return request(`/userAddress/getOrderAddress`);
}

/**
 * 删除地址
 */
export const delAddressApi = (id) => {
  return request(`/userAddress/delete/${id}`);
}

/**
 * 添加地址
 */
export const saveAddressApi = (data) => {
  return request(`/userAddress/save`, data, 'POST');
}

/**
 * 修改地址
 */
export const updateAddressApi = (data) => {
  return request(`/userAddress/update`, data, 'POST');
}

/**
 * 获取地址详情
 */
export const getAddressDetailApi = (id) => {
  return request(`/userAddress/${id}`);
}

